]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
systemActions: Disable power-off if querying support fails
authorFlorian Müllner <fmuellner@gnome.org>
Sat, 9 Jul 2022 12:01:17 +0000 (14:01 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Sat, 9 Jul 2022 12:01:17 +0000 (14:01 +0200)
Treating failure as success is weird. It's also most likely wrong,
as the most likely reason is that gnome-session isn't running.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2372>

js/misc/systemActions.js

index b43f93a3ded78ad5981528fc47db70027cda3628..6d0e0497cf7795d5359449b1023cbc9b4d0f8b02 100644 (file)
@@ -331,10 +331,7 @@ const SystemActions = GObject.registerClass({
 
     _updateHaveShutdown() {
         this._session.CanShutdownRemote((result, error) => {
-            if (error)
-                return;
-
-            this._canHavePowerOff = result[0];
+            this._canHavePowerOff = error ? false : result[0];
             this._updatePowerOff();
         });
     }